#ifndef MYSLIDE_H
#define MYSLIDE_H

#include <QFrame>

namespace Ui {
class MySlide;
}

class MySlide : public QFrame
{
    Q_OBJECT
    
public:
    explicit MySlide(QWidget *parent = 0,QString title=NULL,QString actionLeft=NULL,
                     QString unit=NULL,QString actionRight=NULL);
    ~MySlide();
    
    void SetValueSet(double value);
    void SetValuePre(double value);//auto
    void SetValueCurrent(double value);
    void SetValue(double value);//load
    void SetScope(double min,double max,int num);

    double GetValueSet();
private:
    Ui::MySlide *ui;
    double valueMin;
    double valueMax;
    int totalSteps;
    double valueCurrent;//
    double valueSet;
    int num;//小数位
    double valuePre;
    bool bIsValueSet;
    //增加变量：最后一次自动设置的值（非手动拖动的值）

    bool eventFilter(QObject *obj, QEvent *event);
private slots:
    void UpdateValue(double);
    void PlusValue();
    void MinusValue();

signals:
    void SIG_ValueSet();

};

#endif // MYSLIDE_H
